 /**
 *!
 * \file        b_hal_adc.c
 * \version     v0.0.1
 * \date        2024/03/21
 * \author      Bean(notrynohigh@outlook.com)
 *******************************************************************************
 * @attention
 *
 * Copyright (c) 2024 Bean
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *******************************************************************************
 */
/*Includes ----------------------------------------------*/
#include "hal/inc/b_hal.h"

/**
 * \addtogroup B_HAL
 * \{
 */

/**
 * \addtogroup ADC
 * \{
 */

/**
 * \defgroup ADC_Private_Variables
 * \{
 */

/**
 * \}
 */

/**
 * \addtogroup ADC_Private_Functions
 * \{
 */

/**
 * \}
 */

/**
 * \addtogroup ADC_Exported_Functions
 * \{
 */
#if defined(__WEAKDEF)
__WEAKDEF int bMcuAdcInit(bAdcConfig_t *config)
{
    return -1;
}

__WEAKDEF int bMcuAdcDeInit(void)
{
    return -1;
}

__WEAKDEF int bMcuAdcStart(void)
{
    return -1;
}

__WEAKDEF int bMcuAdcStop(void)
{
    return -1;
}

__WEAKDEF int bMcuAdcRead(bAdcChannel_t channel, uint16_t *value)
{
    return -1;
}

__WEAKDEF int bMcuAdcReadMulti(bAdcChannel_t *channels, uint16_t *values, uint8_t count)
{
    return -1;
}
#endif
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------

int bHalAdcInit(bAdcConfig_t *config)
{
    if(config == NULL) return -1;
    return bMcuAdcInit(config);
}

int bHalAdcDeInit(void)
{
    return bMcuAdcDeInit();
}

int bHalAdcStart(void)
{
    return bMcuAdcStart();
}

int bHalAdcStop(void)
{
    return bMcuAdcStop();
}

int bHalAdcRead(bAdcChannel_t channel, uint16_t *value)
{
    if(value == NULL) return -1;
    return bMcuAdcRead(channel, value);
}

int bHalAdcReadMulti(bAdcChannel_t *channels, uint16_t *values, uint8_t count)
{
    if(channels == NULL || values == NULL || count == 0) return -1;
    return bMcuAdcReadMulti(channels, values, count);
}

/**
 * \}
 */

/**
 * \}
 */

/**
 * \}
 */

/************************ Copyright (c) 2024 Bean *****END OF FILE****/